/**
 * 生成随机数字
 * @param min
 * @param max
 * @returns
 */
export const randomNum = (min: number = 0, max: number = 10000) => {
  return Math.floor(Math.random() * (max - min)) + min;
};

/**
 * 生成随机字符和数字
 */
export const randomStr = (len: number = 4) => {
  const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  let result = '';
  for (let i = len; i > 0; --i) {
    result += str[Math.floor(Math.random() * str.length)];
  }
  return result;
};
